// ****************************************************************************** 
// Copyright     :  Copyright (C) 2018, Hisilicon Technologies Co. Ltd.
// File name     :  hipciec_global_reg_2_c_union_define.h
// Project line  :  Platform And Key Technologies Development
// Department    :  CAD Development Department
// Author        :  xxx
// Version       :  1.0
// Date          :  2017/10/24
// Description   :  The description of xxx project
// Others        :  Generated automatically by nManager V4.2 
// History       :  xxx 2018/03/16 18:02:59 Create file
// ******************************************************************************

#ifndef __HIPCIEC_GLOBAL_REG_2_C_UNION_DEFINE_H__
#define __HIPCIEC_GLOBAL_REG_2_C_UNION_DEFINE_H__

/* Define the union U_PORT_RESET */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    port_ctrl_sft_rst : 16  ; /* [31:16] */
        unsigned int    port_sft_rst      : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PORT_RESET;

/* Define the union U_PORT_EN */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_0   : 16  ; /* [31:16] */
        unsigned int    port_en : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PORT_EN;

/* Define the union U_PHY_RESET */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    linkdown_clr_port_en : 16  ; /* [31:16] */
        unsigned int    port_sticky_sft_rst  : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PHY_RESET;

/* Define the union U_PORT_RESET_CFG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    linkdown_rst_en  : 16  ; /* [31:16] */
        unsigned int    linkdown_rst_num : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PORT_RESET_CFG;

/* Define the union U_TURBO_SIM_SEL */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_1     : 31  ; /* [31:1] */
        unsigned int    turbo_sim : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_TURBO_SIM_SEL;

/* Define the union U_LOCAL_LOOPBACK_MODE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_2               : 16  ; /* [31:16] */
        unsigned int    local_loopback_mode : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_LOCAL_LOOPBACK_MODE;

/* Define the union U_PCIE_SRAM_TIMING_CFG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_3          : 10  ; /* [31:22] */
        unsigned int    mem_power_mode : 6  ; /* [21:16] */
        unsigned int    tp_ram_tmod    : 8  ; /* [15:8] */
        unsigned int    rsv_4          : 1  ; /* [7] */
        unsigned int    sp_ram_tmod    : 7  ; /* [6:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PCIE_SRAM_TIMING_CFG;

/* Define the union U_PCIE_SRAM_TIMING_CFG1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_5        : 24  ; /* [31:8] */
        unsigned int    tp_ram_tmod1 : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PCIE_SRAM_TIMING_CFG1;

/* Define the union U_CFG_FUN_SEL */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_6         : 23  ; /* [31:9] */
        unsigned int    cfg_pf_vf_sel : 1  ; /* [8] */
        unsigned int    cfg_func_sel  : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CFG_FUN_SEL;

/* Define the union U_INSERT_SKP_DATA_PARITY_ERR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_7                         : 16  ; /* [31:16] */
        unsigned int    skp_data_parity_err_inject_en : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_INSERT_SKP_DATA_PARITY_ERR;

/* Define the union U_GLB_PCIEC_MODE_SEL */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_8          : 16  ; /* [31:16] */
        unsigned int    pciec_mode_sel : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_GLB_PCIEC_MODE_SEL;

/* Define the union U_PORT_INT_STATUS_0_7 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_9           : 8  ; /* [31:24] */
        unsigned int    port_int_ro_0_7 : 24  ; /* [23:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PORT_INT_STATUS_0_7;

/* Define the union U_PORT_INT_STATUS_8_15 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_10           : 8  ; /* [31:24] */
        unsigned int    port_int_ro_8_15 : 24  ; /* [23:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PORT_INT_STATUS_8_15;

/* Define the union U_PCIE_RELEASE_I */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    pcie_release_date : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PCIE_RELEASE_I;

/* Define the union U_PCIE_VERSION_I */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    pcie_version : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PCIE_VERSION_I;

/* Define the union U_CORE_INT_SET */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_11       : 20  ; /* [31:12] */
        unsigned int    core_int_set : 12  ; /* [11:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CORE_INT_SET;

/* Define the union U_CORE_INT_MSK */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_12        : 20  ; /* [31:12] */
        unsigned int    core_int_mask : 12  ; /* [11:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CORE_INT_MSK;

/* Define the union U_CORE_INT_RO */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_13      : 20  ; /* [31:12] */
        unsigned int    core_int_ro : 12  ; /* [11:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CORE_INT_RO;

/* Define the union U_CORE_INT_STATUS */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_14                 : 20  ; /* [31:12] */
        unsigned int    hlk_int_status         : 9  ; /* [11:3] */
        unsigned int    apb_timeout_int_status : 1  ; /* [2] */
        unsigned int    port_int_status_8_15   : 1  ; /* [1] */
        unsigned int    port_int_status_0_7    : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CORE_INT_STATUS;

/* Define the union U_CORE_CLK_FLG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    dfx_coreclk_exist  : 16  ; /* [31:16] */
        unsigned int    dfx_coreclk_detect : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CORE_CLK_FLG;

/* Define the union U_APB_ECO */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_15    : 16  ; /* [31:16] */
        unsigned int    eco_regif : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_APB_ECO;

/* Define the union U_PORT07_LINK_MODE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_16          : 1  ; /* [31] */
        unsigned int    port7_link_mode : 3  ; /* [30:28] */
        unsigned int    rsv_17          : 1  ; /* [27] */
        unsigned int    port6_link_mode : 3  ; /* [26:24] */
        unsigned int    rsv_18          : 1  ; /* [23] */
        unsigned int    port5_link_mode : 3  ; /* [22:20] */
        unsigned int    rsv_19          : 1  ; /* [19] */
        unsigned int    port4_link_mode : 3  ; /* [18:16] */
        unsigned int    rsv_20          : 1  ; /* [15] */
        unsigned int    port3_link_mode : 3  ; /* [14:12] */
        unsigned int    rsv_21          : 1  ; /* [11] */
        unsigned int    port2_link_mode : 3  ; /* [10:8] */
        unsigned int    rsv_22          : 1  ; /* [7] */
        unsigned int    port1_link_mode : 3  ; /* [6:4] */
        unsigned int    rsv_23          : 1  ; /* [3] */
        unsigned int    port0_link_mode : 3  ; /* [2:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PORT07_LINK_MODE;

/* Define the union U_PORT815_LINK_MODE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_24           : 1  ; /* [31] */
        unsigned int    port15_link_mode : 3  ; /* [30:28] */
        unsigned int    rsv_25           : 1  ; /* [27] */
        unsigned int    port14_link_mode : 3  ; /* [26:24] */
        unsigned int    rsv_26           : 1  ; /* [23] */
        unsigned int    port13_link_mode : 3  ; /* [22:20] */
        unsigned int    rsv_27           : 1  ; /* [19] */
        unsigned int    port12_link_mode : 3  ; /* [18:16] */
        unsigned int    rsv_28           : 1  ; /* [15] */
        unsigned int    port11_link_mode : 3  ; /* [14:12] */
        unsigned int    rsv_29           : 1  ; /* [11] */
        unsigned int    port10_link_mode : 3  ; /* [10:8] */
        unsigned int    rsv_30           : 1  ; /* [7] */
        unsigned int    port9_link_mode  : 3  ; /* [6:4] */
        unsigned int    rsv_31           : 1  ; /* [3] */
        unsigned int    port8_link_mode  : 3  ; /* [2:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PORT815_LINK_MODE;

/* Define the union U_PCS_SOFT_REST */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_32           : 15  ; /* [31:17] */
        unsigned int    pcs_sft_rst      : 1  ; /* [16] */
        unsigned int    pcs_lane_sft_rst : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PCS_SOFT_REST;

/* Define the union U_PORT_RST_DLY_CNT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_33          : 16  ; /* [31:16] */
        unsigned int    cfg_rst_dly_cnt : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PORT_RST_DLY_CNT;

/* Define the union U_PORT_INT_STATUS_B_0_7 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_34               : 8  ; /* [31:24] */
        unsigned int    port_busi_int_ro_0_7 : 24  ; /* [23:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PORT_INT_STATUS_B_0_7;

/* Define the union U_PORT_INT_STATUS_B_8_15 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_35                : 8  ; /* [31:24] */
        unsigned int    port_busi_int_ro_8_15 : 24  ; /* [23:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PORT_INT_STATUS_B_8_15;

/* Define the union U_CORE_INT_SET_B */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_36            : 30  ; /* [31:2] */
        unsigned int    core_busi_int_set : 2  ; /* [1:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CORE_INT_SET_B;

/* Define the union U_CORE_INT_MSK_B */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_37             : 30  ; /* [31:2] */
        unsigned int    core_busi_int_mask : 2  ; /* [1:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CORE_INT_MSK_B;

/* Define the union U_CORE_INT_RO_B */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_38           : 30  ; /* [31:2] */
        unsigned int    core_busi_int_ro : 2  ; /* [1:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CORE_INT_RO_B;

/* Define the union U_CORE_INT_STATUS_B */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_39                    : 30  ; /* [31:2] */
        unsigned int    port_busi_int_status_8_15 : 1  ; /* [1] */
        unsigned int    port_busi_int_status_0_7  : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CORE_INT_STATUS_B;


//==============================================================================
/* Define the global struct */
typedef struct
{
    volatile U_PORT_RESET                 PORT_RESET                 ; /* 0 */
    volatile U_PORT_EN                    PORT_EN                    ; /* 4 */
    volatile U_PHY_RESET                  PHY_RESET                  ; /* 8 */
    volatile U_PORT_RESET_CFG             PORT_RESET_CFG             ; /* C */
    volatile U_TURBO_SIM_SEL              TURBO_SIM_SEL              ; /* 10 */
    volatile U_LOCAL_LOOPBACK_MODE        LOCAL_LOOPBACK_MODE        ; /* 14 */
    volatile U_PCIE_SRAM_TIMING_CFG       PCIE_SRAM_TIMING_CFG       ; /* 18 */
    volatile U_PCIE_SRAM_TIMING_CFG1      PCIE_SRAM_TIMING_CFG1      ; /* 1C */
    volatile U_CFG_FUN_SEL                CFG_FUN_SEL                ; /* 28 */
    volatile U_INSERT_SKP_DATA_PARITY_ERR INSERT_SKP_DATA_PARITY_ERR ; /* 7C */
    volatile U_GLB_PCIEC_MODE_SEL         GLB_PCIEC_MODE_SEL         ; /* 80 */
    volatile U_PORT_INT_STATUS_0_7        PORT_INT_STATUS_0_7        ; /* 84 */
    volatile U_PORT_INT_STATUS_8_15       PORT_INT_STATUS_8_15       ; /* 88 */
    volatile U_PCIE_RELEASE_I             PCIE_RELEASE_I             ; /* 8C */
    volatile U_PCIE_VERSION_I             PCIE_VERSION_I             ; /* 90 */
    volatile U_CORE_INT_SET               CORE_INT_SET               ; /* 94 */
    volatile U_CORE_INT_MSK               CORE_INT_MSK               ; /* 98 */
    volatile U_CORE_INT_RO                CORE_INT_RO                ; /* 9C */
    volatile U_CORE_INT_STATUS            CORE_INT_STATUS            ; /* A0 */
    volatile U_CORE_CLK_FLG               CORE_CLK_FLG               ; /* A4 */
    volatile U_APB_ECO                    APB_ECO                    ; /* B0 */
    volatile U_PORT07_LINK_MODE           PORT07_LINK_MODE           ; /* B4 */
    volatile U_PORT815_LINK_MODE          PORT815_LINK_MODE          ; /* B8 */
    volatile U_PCS_SOFT_REST              PCS_SOFT_REST              ; /* BC */
    volatile U_PORT_RST_DLY_CNT           PORT_RST_DLY_CNT           ; /* C0 */
    volatile U_PORT_INT_STATUS_B_0_7      PORT_INT_STATUS_B_0_7      ; /* C4 */
    volatile U_PORT_INT_STATUS_B_8_15     PORT_INT_STATUS_B_8_15     ; /* C8 */
    volatile U_CORE_INT_SET_B             CORE_INT_SET_B             ; /* CC */
    volatile U_CORE_INT_MSK_B             CORE_INT_MSK_B             ; /* D0 */
    volatile U_CORE_INT_RO_B              CORE_INT_RO_B              ; /* D4 */
    volatile U_CORE_INT_STATUS_B          CORE_INT_STATUS_B          ; /* D8 */

} S_hipciec_global_reg_2_REGS_TYPE;

/* Declare the struct pointor of the module hipciec_global_reg_2 */
extern volatile S_hipciec_global_reg_2_REGS_TYPE *gophipciec_global_reg_2AllReg;

/* Declare the functions that set the member value */
int iSetPORT_RESET_port_ctrl_sft_rst(unsigned int uport_ctrl_sft_rst);
int iSetPORT_RESET_port_sft_rst(unsigned int uport_sft_rst);
int iSetPORT_EN_port_en(unsigned int uport_en);
int iSetPHY_RESET_linkdown_clr_port_en(unsigned int ulinkdown_clr_port_en);
int iSetPHY_RESET_port_sticky_sft_rst(unsigned int uport_sticky_sft_rst);
int iSetPORT_RESET_CFG_linkdown_rst_en(unsigned int ulinkdown_rst_en);
int iSetPORT_RESET_CFG_linkdown_rst_num(unsigned int ulinkdown_rst_num);
int iSetTURBO_SIM_SEL_turbo_sim(unsigned int uturbo_sim);
int iSetLOCAL_LOOPBACK_MODE_local_loopback_mode(unsigned int ulocal_loopback_mode);
int iSetPCIE_SRAM_TIMING_CFG_mem_power_mode(unsigned int umem_power_mode);
int iSetPCIE_SRAM_TIMING_CFG_tp_ram_tmod(unsigned int utp_ram_tmod);
int iSetPCIE_SRAM_TIMING_CFG_sp_ram_tmod(unsigned int usp_ram_tmod);
int iSetPCIE_SRAM_TIMING_CFG1_tp_ram_tmod1(unsigned int utp_ram_tmod1);
int iSetCFG_FUN_SEL_cfg_pf_vf_sel(unsigned int ucfg_pf_vf_sel);
int iSetCFG_FUN_SEL_cfg_func_sel(unsigned int ucfg_func_sel);
int iSetINSERT_SKP_DATA_PARITY_ERR_skp_data_parity_err_inject_en(unsigned int uskp_data_parity_err_inject_en);
int iSetGLB_PCIEC_MODE_SEL_pciec_mode_sel(unsigned int upciec_mode_sel);
int iSetPORT_INT_STATUS_0_7_port_int_ro_0_7(unsigned int uport_int_ro_0_7);
int iSetPORT_INT_STATUS_8_15_port_int_ro_8_15(unsigned int uport_int_ro_8_15);
int iSetPCIE_RELEASE_I_pcie_release_date(unsigned int upcie_release_date);
int iSetPCIE_VERSION_I_pcie_version(unsigned int upcie_version);
int iSetCORE_INT_SET_core_int_set(unsigned int ucore_int_set);
int iSetCORE_INT_MSK_core_int_mask(unsigned int ucore_int_mask);
int iSetCORE_INT_RO_core_int_ro(unsigned int ucore_int_ro);
int iSetCORE_INT_STATUS_hlk_int_status(unsigned int uhlk_int_status);
int iSetCORE_INT_STATUS_apb_timeout_int_status(unsigned int uapb_timeout_int_status);
int iSetCORE_INT_STATUS_port_int_status_8_15(unsigned int uport_int_status_8_15);
int iSetCORE_INT_STATUS_port_int_status_0_7(unsigned int uport_int_status_0_7);
int iSetCORE_CLK_FLG_dfx_coreclk_exist(unsigned int udfx_coreclk_exist);
int iSetCORE_CLK_FLG_dfx_coreclk_detect(unsigned int udfx_coreclk_detect);
int iSetAPB_ECO_eco_regif(unsigned int ueco_regif);
int iSetPORT07_LINK_MODE_port7_link_mode(unsigned int uport7_link_mode);
int iSetPORT07_LINK_MODE_port6_link_mode(unsigned int uport6_link_mode);
int iSetPORT07_LINK_MODE_port5_link_mode(unsigned int uport5_link_mode);
int iSetPORT07_LINK_MODE_port4_link_mode(unsigned int uport4_link_mode);
int iSetPORT07_LINK_MODE_port3_link_mode(unsigned int uport3_link_mode);
int iSetPORT07_LINK_MODE_port2_link_mode(unsigned int uport2_link_mode);
int iSetPORT07_LINK_MODE_port1_link_mode(unsigned int uport1_link_mode);
int iSetPORT07_LINK_MODE_port0_link_mode(unsigned int uport0_link_mode);
int iSetPORT815_LINK_MODE_port15_link_mode(unsigned int uport15_link_mode);
int iSetPORT815_LINK_MODE_port14_link_mode(unsigned int uport14_link_mode);
int iSetPORT815_LINK_MODE_port13_link_mode(unsigned int uport13_link_mode);
int iSetPORT815_LINK_MODE_port12_link_mode(unsigned int uport12_link_mode);
int iSetPORT815_LINK_MODE_port11_link_mode(unsigned int uport11_link_mode);
int iSetPORT815_LINK_MODE_port10_link_mode(unsigned int uport10_link_mode);
int iSetPORT815_LINK_MODE_port9_link_mode(unsigned int uport9_link_mode);
int iSetPORT815_LINK_MODE_port8_link_mode(unsigned int uport8_link_mode);
int iSetPCS_SOFT_REST_pcs_sft_rst(unsigned int upcs_sft_rst);
int iSetPCS_SOFT_REST_pcs_lane_sft_rst(unsigned int upcs_lane_sft_rst);
int iSetPORT_RST_DLY_CNT_cfg_rst_dly_cnt(unsigned int ucfg_rst_dly_cnt);
int iSetPORT_INT_STATUS_B_0_7_port_busi_int_ro_0_7(unsigned int uport_busi_int_ro_0_7);
int iSetPORT_INT_STATUS_B_8_15_port_busi_int_ro_8_15(unsigned int uport_busi_int_ro_8_15);
int iSetCORE_INT_SET_B_core_busi_int_set(unsigned int ucore_busi_int_set);
int iSetCORE_INT_MSK_B_core_busi_int_mask(unsigned int ucore_busi_int_mask);
int iSetCORE_INT_RO_B_core_busi_int_ro(unsigned int ucore_busi_int_ro);
int iSetCORE_INT_STATUS_B_port_busi_int_status_8_15(unsigned int uport_busi_int_status_8_15);
int iSetCORE_INT_STATUS_B_port_busi_int_status_0_7(unsigned int uport_busi_int_status_0_7);

#endif // __HIPCIEC_GLOBAL_REG_2_C_UNION_DEFINE_H__
